package edu.sctu.zcy.month201505.day20150517;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Created by user24 on 2015/5/17.
 */
public class TextMore {

    SaveInfo saveInfo = new SaveInfo();

    List<TeaCher> teacherlist = saveInfo.getInfo();

    List<Student> studentlist = new ArrayList<>();

    public List<TeaCher> sotrNumber(){

        Collections.sort(teacherlist);

        return teacherlist;
    }

    public List<Student> sortStudent(){


//        studentlist.add(teacherlist.get(0).getStudents().get(0));
//        studentlist.add(teacherlist.get(0).getStudents().get(1));
//
//
//
//        studentlist.add(teacherlist.get(1).getStudents().get(0));
//        studentlist.add(teacherlist.get(1).getStudents().get(1));
//        studentlist.add(teacherlist.get(1).getStudents().get(2));
//
//        studentlist.add(teacherlist.get(2).getStudents().get(0));
//
//        studentlist.add(teacherlist.get(3).getStudents().get(0));
//        studentlist.add(teacherlist.get(3).getStudents().get(1));
//        studentlist.add(teacherlist.get(3).getStudents().get(2));
//        studentlist.add(teacherlist.get(3).getStudents().get(3));

        for(int j = 0;j < teacherlist.size();j++){
            for (int i = 0; i < teacherlist.get(j).getStudents().size(); i++) {
                studentlist.add(teacherlist.get(j).getStudents().get(i));

            }
        }

        Collections.sort(studentlist);
        return studentlist;

    }

    public List<TeaCher> pritCoded(){

       List<TeaCher> list = new ArrayList<>();

        for(TeaCher t : teacherlist){

            if(t.getTechnicalTitle().equals("教授")){

                list.add(t);

            }
        }

        return list;
    }
}
